package com.cqan.box.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cqan.entity.pk.LongEntity;

@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "TBL_BOX_MESSAGE")
//默认的缓存策略.
@SuppressWarnings("serial")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Message extends LongEntity {
	
	private String sid;
	
	private String client;
	
	private String token;
	
	private String message;
	
	private String type;
	
	private Date ctime;

	@Column(name="CLIENT")
	public String getClient() {
		return client;
	}

	@Column(name="CTIME")
	public Date getCtime() {
		return ctime;
	}

	@Column(name="MESSAGE")
	public String getMessage() {
		return message;
	}

	@Column(name="SID")
	public String getSid() {
		return sid;
	}

	@Column(name="TOKEN")
	public String getToken() {
		return token;
	}

	@Column(name="TYPE")
	public String getType() {
		return type;
	}

	public void setClient(String client) {
		this.client = client;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public void setType(String type) {
		this.type = type;
	}

	

	@Override
	public String toString() {
		
		return ToStringBuilder.reflectionToString(this);
	}
	
	
}
